/**
 * form 2 JSON
 * @ author huyj
 * 2013 -04-21 
 */

$.fn.serializeObject = function() {
    var o = {};
    var a = this.serializeArray();
    $.each(a, function() {
            o[this.name] = this.value || '';
      });
    return o;
}

function submitForm(formId,url){
		var param = $("#"+formId).serialize();
		  $.ajax({
		   type: "POST",
		   url: url,
		   data: param,
		   dataType:"json",
		   success: function(msg){
		    
		    if(msg.returnCode==0){
		      top.$.dicBox({
		        style : 1,
				content : msg.msg//消息内容
				});
				}else{
			    top.$.dicBox({
		        style : 3,
				content : msg.msg//消息内容 
				});
				}
		   }
		});
 }

 function showWindow(url,title,width,height){
	var	win =   $.dicWin({
				title : title ,  //标题设置
				width : width,  //窗口的宽度设置
				height : height,  //窗口的高度设置
				drag : true,  //能否拖动窗口
				url : url     //远程窗口(无content属性的情况下适用)
			  });
		return win;
 }